package com.killer;

import com.killer.factory.RpcFactory;
import com.killer.handler.RpcClientHandler;
import com.killer.pojo.Order;
import com.killer.pojo.User;
import com.killer.rpc.RpcEncoder;
import com.killer.serializer.JsonSerializer;
import com.killer.service.OrderService;
import com.killer.service.UserService;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.string.StringDecoder;

/**
 * @author ：Killer
 * @date ：Created in 20-11-27 上午11:19
 * @description：${description}
 * @modified By：
 * @version: version
 */
public class RpcClient {

    public static void main(String[] args) {
        UserService userService = RpcFactory.getRpcFactory().getObject(UserService.class);
        String result = userService.sayHello(new User(1l, "张三", 22));
        System.out.println(result);

        OrderService orderService = RpcFactory.getRpcFactory().getObject(OrderService.class);
        result = orderService.addOrder(new Order(1l, "拉布拉多"));
        System.out.println(result);
    }
}
